# encoding: utf-8
import sys   
reload(sys)
sys.setdefaultencoding('utf-8')
from traceback import print_tb
import matplotlib.pyplot as plt;
import numpy as np;
import pandas as pd

data=pd.read_table("/home/student/桌面/HW2/E.txt",sep=',',header=None)

x=data[0]
xx=np.arange(0,43,0.01)
plt.figure()
for i in range(1,3):
    p=data[i][0]
    for l in range(1,len(x)):
        s=1
        for j in range(l):
            s=s*(xx-x[j])
        p=p+s*data[i][l]
    plt.plot(xx,p)
plt.title("the curve of exerciseE")
plt.savefig("E.png")